package cn.edu.wfit.modules.infomanagement.service.impl;

import java.util.List;
import cn.edu.wfit.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.edu.wfit.modules.infomanagement.mapper.CollegeMapper;
import cn.edu.wfit.modules.infomanagement.domain.College;
import cn.edu.wfit.modules.infomanagement.service.ICollegeService;

/**
 * 二级学院Service业务层处理
 * 
 * @author 韩强
 * @date 2024-11-15
 */
@Service
public class CollegeServiceImpl implements ICollegeService 
{
    @Autowired
    private CollegeMapper collegeMapper;

    /**
     * 查询二级学院
     * 
     * @param collegeId 二级学院主键
     * @return 二级学院
     */
    @Override
    public College selectCollegeByCollegeId(Long collegeId)
    {
        return collegeMapper.selectCollegeByCollegeId(collegeId);
    }

    /**
     * 查询二级学院列表
     * 
     * @param college 二级学院
     * @return 二级学院
     */
    @Override
    public List<College> selectCollegeList(College college)
    {
        return collegeMapper.selectCollegeList(college);
    }

    /**
     * 新增二级学院
     * 
     * @param college 二级学院
     * @return 结果
     */
    @Override
    public int insertCollege(College college)
    {
        college.setCreateTime(DateUtils.getNowDate());
        return collegeMapper.insertCollege(college);
    }

    /**
     * 修改二级学院
     * 
     * @param college 二级学院
     * @return 结果
     */
    @Override
    public int updateCollege(College college)
    {
        college.setUpdateTime(DateUtils.getNowDate());
        return collegeMapper.updateCollege(college);
    }

    /**
     * 批量删除二级学院
     * 
     * @param collegeIds 需要删除的二级学院主键
     * @return 结果
     */
    @Override
    public int deleteCollegeByCollegeIds(Long[] collegeIds)
    {
        return collegeMapper.deleteCollegeByCollegeIds(collegeIds);
    }

    /**
     * 删除二级学院信息
     * 
     * @param collegeId 二级学院主键
     * @return 结果
     */
    @Override
    public int deleteCollegeByCollegeId(Long collegeId)
    {
        return collegeMapper.deleteCollegeByCollegeId(collegeId);
    }
}
